package net.tolkv.tdd;

import java.util.UUID;

public class Book extends Item {
	private String author;
	private String title;
	private String publisher;
	private String date;
	public String getDate() {
		return date;
	}

	public void setDate(String date) {
		this.date = date;
	}

	public Book(String author) {
		super(UUID.randomUUID());
		this.setAuthor(author);
	}
	
	public Book(UUID id){
		super(id);
	}

	public Book(String string, String string2) {
		this(string);
		setTitle(string2);
	}

	public Book(String string, String string2, String string3) {
		this(string, string2);
		this.setPublisher(string3);
	}

	public Book(String string, String string2, String string3, String string4) {
		this(string, string2, string3);
		this.date = string4;
	}

	public String getAuthor() {
		return this.author;
	}

	public String getTitle() {
		String tmp=title;
		if(getPublisher()!=null) {
			tmp += " [" + getPublisher() + "]";
		}
		if(date!=null) {
			tmp+=  " [" + date + "]";
		}
		return tmp;
	}

	public void setAuthor(String author) {
		this.author = author;
	}

	public void setTitle(String title) {
		this.title = title;
	}

	public String getPublisher() {
		return publisher;
	}

	public void setPublisher(String publisher) {
		this.publisher = publisher;
	}
}
